package com.ruoyi.web.controller.retirement;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.retirement.domain.RetirementArticle;
import com.ruoyi.retirement.service.IRetirementArticlePublishedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 已发布文章Controller
 * 
 * @author 曹旭
 * @date 2025-09-03
 */
@RestController
@RequestMapping("/retirement/retirementArticlePublished")
public class RetirementArticlePublishedController extends BaseController
{
    @Autowired
    private IRetirementArticlePublishedService retirementArticlePublishedService;

    /**
     * 查询已发布文章列表
     */
    @PreAuthorize("@ss.hasPermi('retirement:retirementArticlePublished:list')")
    @GetMapping("/list")
    public TableDataInfo list(RetirementArticle retirementArticlePublished)
    {
        startPage();
        List<RetirementArticle> list = retirementArticlePublishedService.selectRetirementArticlePublishedList(retirementArticlePublished);
        return getDataTable(list);
    }


    /**
     * 查询已发布文章列表
     */
    @GetMapping("/getList")
    public AjaxResult getList(RetirementArticle retirementArticlePublished)
    {
        List<RetirementArticle> list = retirementArticlePublishedService.selectRetirementArticlePublishedList(retirementArticlePublished);
        return success(list);
    }

}
